package public

import (
	"gitcode.com/G-YT/iHealth25/server/api/v1"
	"gitcode.com/G-YT/iHealth25/server/middleware"
	"github.com/gin-gonic/gin"
)

type MessageRouter struct {
}

// InitMessageRouter 初始化 消息 路由信息
func (s *MessageRouter) InitMessageRouter(Router *gin.RouterGroup, pub *gin.RouterGroup) {
	messageRouter := Router.Group("message").Use(middleware.OperationRecord())
	messageRouterWithoutRecord := Router.Group("message")
	messagePubRouter := pub.Group("message")
	var messageApi = v1.ApiGroupApp.PublicApiGroup.MessageApi
	{
		messageRouter.POST("createMessage", messageApi.CreateMessage)             // 新建消息
		messageRouter.DELETE("deleteMessage", messageApi.DeleteMessage)           // 删除消息
		messageRouter.DELETE("deleteMessageByIds", messageApi.DeleteMessageByIds) // 批量删除消息
		messageRouter.PUT("updateMessage", messageApi.UpdateMessage)              // 更新消息
	}
	{
		messageRouterWithoutRecord.GET("findMessage", messageApi.FindMessage)       // 根据ID获取消息
		messageRouterWithoutRecord.GET("getMessageList", messageApi.GetMessageList) // 获取消息列表
	}
	{
		messagePubRouter.GET("getUserMessage", messageApi.GetUserMessage)                 // 根据ID获取消息
		messagePubRouter.GET("getUserMessageInfoList", messageApi.GetUserMessageInfoList) // 获取消息列表
	}
}
